/*
* 带标题的ul
* titleImg:标题图标
* title：标题
* content：ul主体
* {
* href：跳转链接
* message：显示文本
* }
*
*
* */
'use strict';
var React = require('react');
class ReUlWithTitle extends React.Component {
    constructor(props) {
        super(props);
        this.renderLi=this.renderLi.bind(this);
    }

    renderLi() {
        return this.props.content.map((item,i)=>{
            return <li key={"ReUlWithTitle"+i}><a href={item.href} target={item.reTarget}>{item.message}</a></li>
        });
    }

    render() {
        return (
            <div className="ReUlWithTitle_Container">
                <div className="ReUlWithTitle_Title">
                    <img src={this.props.titleImg}/>
                    <span>{this.props.title}</span>
                </div>
                <ul className="ReUlWithTitle_Ul">
                    {this.renderLi()}
                </ul>
            </div>
        );
    }
}

ReUlWithTitle.propTypes={
    titleImg: React.PropTypes.string,
    title:React.PropTypes.string,
    content:React.PropTypes.array
};

module.exports=ReUlWithTitle;
